import { createApp } from 'vue'
import App from './App.vue'
import router from './router'

// Element Plus 组件（按需引入）
import { ElDialog, ElInput, ElButton, ElProgress } from 'element-plus'
import 'element-plus/dist/index.css' // 必须引入样式！

// Font Awesome 图标
import { fab } from '@fortawesome/free-brands-svg-icons'
import { library } from '@fortawesome/fontawesome-svg-core'
import { fas } from '@fortawesome/free-solid-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'

library.add(fas, fab)

const app = createApp(App)

// 全局注册 Element 组件（替代局部注册）
app.component(ElDialog.name, ElDialog)
app.component(ElInput.name, ElInput)
app.component(ElButton.name, ElButton)
app.component(ElProgress.name, ElProgress)

// 全局注册图标组件
app.component('font-awesome-icon', FontAwesomeIcon)

app.use(router) // 挂载路由
app.mount('#app')